﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MiniTool.Extension
{
    public static class StrExtension
    {

        /// <summary>
        /// Checks if the specified string is null or empty.
        /// </summary>
        /// <param name="str">The string to check.</param>
        /// <returns>True if the string is null or empty; otherwise, false.</returns>
        public static bool IsNullOrEmpty(this string str) => string.IsNullOrEmpty(str);

        /// <summary>
        /// Checks if the specified string is null, empty, or consists only of white-space characters.
        /// </summary>
        /// <param name="str">The string to check.</param>
        /// <returns>True if the string is null, empty, or contains only white-space characters; otherwise, false.</returns>
        public static bool IsNullOrWhiteSpace(this string str) => string.IsNullOrWhiteSpace(str);



        /// <summary>
        /// Checks if the specified string is not null or empty.
        /// </summary>
        /// <param name="str">The string to check.</param>
        /// <returns>True if the string is not null or empty; otherwise, false.</returns>
        public static bool IsNotNullOrEmpty(this string str) => !string.IsNullOrEmpty(str);

        /// <summary>
        /// Checks if the specified string is not null, empty, or consists only of white-space characters.
        /// </summary>
        /// <param name="str">The string to check.</param>
        /// <returns>True if the string is not null, empty, or contains non-white-space characters; otherwise, false.</returns>
        public static bool IsNotNullOrWhiteSpace(this string str) => !string.IsNullOrWhiteSpace(str);
    }
}
